package com.gouying.design.patterns.observer;

import java.util.ArrayList;
import java.util.List;

public class LeijiaYin extends ZhuBo {

    List<Fans> fansList = new ArrayList<Fans>();

    LeijiaYin(String name) {
        this.name = name;
    }

    @Override
    void addFans(Fans fans) {
        fansList.add(fans);
    }

    @Override
    void notify(String msg) {
        for (Fans fans : fansList) {
            fans.accept(msg);
        }
    }


}
